Field of the Invention
The present invention relates to video coding. In particular, the present invention relates to coding techniques for coefficient scan of 8×8 transform units in High Efficiency Video Coding (HEW).
Description of the Related Art
HEVC (High Efficiency Video Coding) is an advanced video coding system being developed under the Joint Collaborative Team on Video Coding (JCT-VC) group of video coding experts from ITU-T Study Group. In HEVC, a 2N×2N coding unit (CU) can be hierarchically partitioned into a partition size selected from 2N×2N, 2N×N, N×2N and N×N. The current HEVC also defines the prediction unit (PU), where a CU may consist of one or multiple PUs. After prediction process is performed on each CU, the residues of each CU are further processed by transformation. In HEVC Test Model Version 5.0 (HM-5.0), transform coefficients of each transform unit (TU) are quantized and then scanned according to as certain scan pattern before Context-adaptive binary arithmetic coding (CABAC). For intra coded transform coefficients, the mode-dependent coefficient scan (MDCS) method is used. Three scan patterns, including diagonal 110, horizontal 120, and vertical scanning 130, as illustrated in FIG. 1, are used to scan the coefficients. A transform unit usually contains some zero-valued quantized transform coefficients in the high frequency region for typical image contents. The scanned coefficients may contain a string of zero-values data at the end. One effective way to code the scanned transform coefficients is to identify and code the string of zeros at the end of scanned transform coefficients. Therefore, the scanned coefficients are often examined from the end toward the beginning to identify number of consecutive zero-valued data at the end of the scanned coefficients. Based on the number of consecutive zero-valued data at the end of the scanned transform coefficients, the consecutive zero-valued data can be coded very efficiently. The number of consecutive zero-valued data at the end of the scanned transform coefficients can be identified by the last non-zero coefficient. In HEVC Test Model Version 5.0 (HM-5.0), the selection of the scan patterns for each intra-coded TU can be based on the intra prediction modes, as shown in Table 1, where 0, 1, and 2 correspond to for diagonal, horizontal, and vertical scan patterns respectively. In HM-5.0, MDCS is only used for intra TUs with sizes of 4×4 and 8×8 as shown in Table 1, while for inter-coded coefficients, only diagonal scanning is used for inter 4×4 and 8×8 TUs.
TABLE 1Intra ModeTU size0123456789101112131415161732 × 3200000000000000000016 × 160000000000000000008 × 80120011022001100224 × 4012001102200110022Intra ModeTU size181920212223242526272829303132333432 × 320000000000000000016 × 16000000000000000008 × 8000111100002222004 × 400011110000222200
As shown in Table 1, diagonal scan pattern is applied to intra-coded 16×16 and 32×32 TUs, while different scan patterns are selectively applied to intra-coded 4×4 and 8×8 TUs.
After transform coefficients are re-ordered according to a scan pattern, CABAC compression is applied to the scanned transform coefficients on a TU by TU basis. In each TU, a last_significant_coeff_x and a last_significant_coeff_y are transmitted first to indicate the last non-zero coefficient position in the predetermined scan order. The TU is then divided into several subsets when the TU size is larger than 4×4. The subsets in the TU are retrieved for coding operation one by one. For one 8×8 TU, the 64 coefficients are divided into 4 subsets according to the diagonal scan through the entire 8×8 TU. Each subset contains 16 continuous coefficients. FIG. 2 shows the 4 subsets in an 8×8 TU as indicated by four different shaded patterns. For square TUs larger than 8×8 (e.g. 16×16 and 32×32) and non-square TUs (e.g. 16×4, 4×16, 32×8, and 8×32), the TU is divided into 4×4 sub-blocks. Each sub-block corresponds to a coefficient subset. For each subset, a significance map (significant_coeff_flag) indicating whether each coefficient is zero or not is coded first. Next, coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, coeff_abs_level_minus3, and coeff_sign_flag are utilized to represent each non-zero coefficient. In HM-5.0, if the TU size equals to 16×16, 32×32, 16×4, 4×16, 32×8, or 8×32, one significant_coeffgroup_flag is coded for each sub-block prior to the level, coding of the sub-block (e.g. the significant_coeff_flag, coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, coeff_abs_level_minus3, and coeff_sign_flag). If significant_coeffgroup_flag equals to 0, it indicates that the entire 4×4 sub-block is zero. The level coding of the sub-block with zero for the entire 4×4 sub-block can be skipped. The significant_coeffgroup_flag is inferred as 1 for the DC sub-block.
In one TU, transform coefficients are divided into multiple subsets and similar CABAC coding operations are applied to each subset. However, in HM-5.0, there are two kinds of subset partitioning using diagonal scanning. One is to partition the scanned transform coefficients of the 8×8 TU using diagonal scanning into multiple subsets, and the other is to partition the scanned transform coefficients of the 8×8 TU into multiple subsets using double diagonal scanning. In the latter case, each subset corresponds to a 4×4 sub-block. From implementation point of view, it is preferable to unify the subset partition methods in order to reduce system complexity and cost.